//
//  Light.m
//  CommandPattern
//
//  Created by ying on 2017/11/21.
//  Copyright © 2017年 ying. All rights reserved.
//

#import "Light.h"

@interface Light ()

@end

@implementation Light

- (instancetype)initWithName:(NSString *)name{
    self = [super init];
    if (self) {
        self.name = name;
    }
    
    return self;
}

- (void)on{
    NSString *onStr = [NSString stringWithFormat:@"%@打开！",self.name];
    NSLog(@"%@",onStr);
}

- (void)off{
    NSString *offStr = [NSString stringWithFormat:@"%@关闭！",self.name];
    NSLog(@"%@",offStr);
}

@end
